package com.rainng.coursesystem.controller.teacher;

import com.rainng.coursesystem.config.themis.annotation.Teacher;
import com.rainng.coursesystem.controller.BaseController;
import com.rainng.coursesystem.model.bo.CourseFormDTO;
import com.rainng.coursesystem.model.bo.CourseResourceDTO;
import com.rainng.coursesystem.model.vo.response.ResultVO;
import com.rainng.coursesystem.service.CourseResourceService;
import com.rainng.coursesystem.service.teacher.CourseService;
import com.rainng.coursesystem.service.teacher.VodService;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.GroupSequence;

@Teacher
@RequestMapping("/teacher/courseResource")
@RestController
public class CourseResourceController extends BaseController {


    @Autowired
    private CourseResourceService courseResourceService;

    @Autowired
    private VodService vodService;

    @GetMapping("{courseId}")
    public ResultVO getResource(@PathVariable Integer courseId){

        return courseResourceService.getResource(courseId);

    }

    @ApiOperation(value = "文件上传")
    @PostMapping("{courseId}")
    public ResultVO fileUpLoad(@PathVariable Integer courseId, CourseResourceDTO dto){
        return vodService.courseResourceUpLoad(courseId,dto);
    }

}
